package com.itheima.a13waitandnotify2;

import java.util.concurrent.ArrayBlockingQueue;

public class ThreadDemo1 {
    public static void main(String[] args) {
        //用阻塞队列来实现生产者消费者模型

        //创建一个阻塞队列
        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(1);

        //创建线程对象
        Cook cook = new Cook(queue);
        Foodie foodie = new Foodie(queue);

        //启动线程
        cook.start();
        foodie.start();
    }
}
